const webpack = require("webpack");
const WebpackDevServer = require("webpack-dev-server");

const webpackConfig = require("./build/webpack.dev.config");

const compiler = webpack(webpackConfig);
const devServerOptions = {
  ...webpackConfig.devServer,
  open: true,
  historyApiFallback: true,
};
const server = new WebpackDevServer(devServerOptions, compiler);
const runServer = async () => {
  console.log("Starting server...");
  await server.start();
};

runServer();
